#include <stdio.h>

int main(){

	int i = 1000;
	int total = 0;
	printf("Pesquisando números 44/55 entre 1000 e 1000000");

	while( i < 1000000000 ){
		int flag = 0;

		if(i%10 == 4){
			if((i/10)%10 == 4){
				if(flag==0)
					total++;printf("achei: %d\n", i);
				flag = 1;
			}
		}

		if(i%10 == 5){
			if((i/10)%10 == 5){
				if(flag==0){
					total++;printf("achei: %d\n", i);
				}
				flag = 1;
			}
		}

		int j = 1;
		while( j <= sizeof( i )){
			int mult = 10;
			if(i/mult%10 == 4){
				if(i/(mult*10)%10 == 4){
					if(flag==0){
						total++;printf("achei: %d\n", i);
					}
					flag = 1;

				}
			}

			if(i/mult%10 == 5){
				if(i/(mult*10)%10 == 5){
					if(flag==0){
						total++;printf("achei: %d\n", i);
					}
					flag = 1;

				}
			}

			mult = mult*10;
			j++;
		}
		i++;

	}
	printf("Total %d\n", total);

}
